package main;

import static main.SympleBoard.BLACK;
import static main.SympleBoard.WHITE;

import java.util.Scanner;

public class RandomBot {

	public static void main(String[] args) {
		SympleBoard b = new SympleBoard();
		Scanner sc = new Scanner(System.in);
		String move = sc.next();
		byte player;
		byte enemy;
		if (move.equals("Start")) {
			player = WHITE;
			enemy = BLACK;
		} else {
			player = BLACK;
			enemy = WHITE;
		}
		while (!move.equals("Quit")) {
			if (!move.equals("Start")) {
				Utilities.parseMove(move, enemy, b);
			}
			int randomMove = (int) (Math.random() * SympleBoard.BOARD_SIZE * SympleBoard.BOARD_SIZE);
			while (!b.checkValidMove(player, randomMove)) {
				randomMove = (int) (Math.random() * SympleBoard.BOARD_SIZE * SympleBoard.BOARD_SIZE);
			}
			b.move(player, randomMove);
			int x = randomMove % SympleBoard.BOARD_SIZE;
			int y = randomMove / SympleBoard.BOARD_SIZE;
			System.out.println("" + SympleBoard.coordinates[x] + "" + (15 - y));
			System.out.flush();

			move = sc.next();
		}
	}
}
